Global Index
HTML5 JS API Index > ECMAScript Tutorials & Specs

Number

See 15.7.1 and 15.7.2.

Properties
const number
MAX_VALUE = 1.7976931348623157e308
The value of Number.MAX_VALUE is the largest positive finite value of the Number type, which is approximately 1.7976931348623157 × 10308.
const number
MIN_VALUE = 5e-324
The value of Number.MIN_VALUE is the smallest positive value of the Number type, which is approximately 5 × 10‑324.
const number
NaN = NaN
The value of Number.NaN is NaN.
const number
NEGATIVE_INFINITY = inf
The value of Number.NEGATIVE_INFINITY is −∞.
const number
POSITIVE_INFINITY = - inf
The value of Number.POSITIVE_INFINITY is +∞.
Constructor
Number(any value)
Operations
string
toExponential(int fractionDigits)
Return a String containing this Number value represented in decimal exponential notation with one digit before the significand's decimal point and fractionDigits digits after the significand's decimal point. If fractionDigits is undefined, include as many significand digits as necessary to uniquely specify the Number (just like in ToString except that in this case the Number is always output in exponential notation).
string
toFixed(int fractionDigits)
Return a String containing this Number value represented in decimal fixed-point notation with fractionDigits digits after the decimal point. If fractionDigits is undefined, 0 is assumed.
string
toLocaleString()
Produces a String value that represents this Number value formatted according to the conventions of the host environment’s current locale. This function is implementation-dependent, and it is permissible, but not encouraged, for it to return the same thing as toString.
string
toPrecision(int precision)
Return a String containing this Number value represented either in decimal exponential notation with one digit before the significand's decimal point and precision–1 digits after the significand's decimal point or in decimal fixed notation with precision significant digits.
string
toString(optional int radix)
The optional radix should be an integer value in the inclusive range 2 to 36. If radix not present or is undefined the Number 10 is used as the value of radix. If ToInteger(radix) is the Number 10 then this Number value is given as an argument to the ToString abstract operation; the resulting String value is returned.
number
valueOf()
Returns this Number value.